{extend name="layout"}
{block name="style"}{/block}
{block name="left_main"}
<style>
    .teacher{
        height:1442px;
    }
   
</style>
<ul class="layui-nav layui-nav-tree" style="width:100%;">
    <li class="layui-nav-item {if in_array(request()->action(),['index'])}layui-this{/if}"><a href="{:url('index/index')}">主页</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['menu'])}layui-this{/if}"><a href="{:url('system/menu')}">菜单管理</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['wechat'])}layui-this{/if}"><a href="{:url('system/wechat')}">公众号管理</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['users'])}layui-this{/if}"><a href="{:url('system/users')}">用户管理</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['ad'])}layui-this{/if}"><a href="{:url('system/ad')}">广告图管理</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['lang'])}layui-this{/if}"><a href="{:url('system/lang')}">多语言管理</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['databases'])}layui-this{/if}"><a href="{:url('system/databases')}">数据库管理</a></li>
    <li class="layui-nav-item {if in_array(request()->action(),['conf'])}layui-this{/if}"><a href="{:url('system/conf')}">系统配置</a></li>
</ul>
{/block}
{block name="right_main"}
<div class="layui-tab layui-tab-brief" style="margin:0;box-shadow:none;border:0;">
    <ul class="layui-tab-title">
        <li {:request()->action()=='conf'?'class="layui-this"':'' }  onclick="location.href='{:url('system/conf')}'">网站信息</li>
    </ul>
    <div class="layui-tab-content" >
        <div class="lyui-tab-item layui-show">
            <form class="layui-form" action="" method="post" style="padding:30px 140px 30px 30px;" >

                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">网站名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" value="{$system['web_name']?:''}"  placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">主Logo</label>
                        <div class="layui-upload layui-input-inline">
                            <button type="button" class="layui-btn layui-btn-primary" id="logo">上传图片</button><input class="layui-upload-file" type="file" name="file">
                            <div class="layui-upload-list">
                                <img class="layui-upload-img" src="__PUBLIC__/{$system['logo']?:'/static/image/upload.png'}" id="logo-img" width="340" height="68">
                                <input type="hidden" name="logo" id="logo-val" value="{$system['logo']?:''}" lay-verify="required" autocomplete="off" class="layui-input">
                            </div>
                            <div id="logo-err"></div>
                        </div>
                        <script>
                            layui.use(['jquery', 'upload'], function(){
                            var $ = layui.jquery;
                            var upload = layui.upload;
                            var uploadInst = upload.render({
                            elem: '#logo',
                                    url: '{:url('upload / image')}',
                                    size:2 * 1024,
                                    before: function(obj){
                                    },
                                    done: function(res){
                                    if (res.code == 1){
                                    $('#logo-img').attr('src', res.src);
                                    $('#logo-img').css('display', 'block');
                                    $('#logo-val').val(res.src);
                                    return true;
                                    }
                                    },
                                    error: function(){
                                    var errText = $('#logo-err');
                                    errText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini logo-reload">重试</a>');
                                    errText.find('.logo-reload').on('click', function(){
                                    uploadInst.upload();
                                    });
                                    }
                            });
                            });
                        </script>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">副Logo</label>
                        <div class="layui-upload layui-input-inline">
                            <button type="button" class="layui-btn layui-btn-primary" id="flogo">上传图片</button><input class="layui-upload-file" type="file" name="file">
                            <div class="layui-upload-list">
                                <img class="layui-upload-img" src="__ROOT__/{$system['flogo']?:'/static/image/upload.png'}" id="flogo-img" width="64" height="64">
                                <input type="hidden" name="flogo" id="flogo-val" value="{$system['flogo']?:''}" lay-verify="required" autocomplete="off" class="layui-input">
                            </div>
                            <div id="flogo-err"></div>
                        </div>
                        <script>
                            layui.use(['jquery', 'upload'], function(){
                            var $ = layui.jquery;
                            var upload = layui.upload;
                            var uploadInst = upload.render({
                            elem: '#flogo',
                                    url: '{:url('upload / image')}',
                                    size:2 * 1024,
                                    before: function(obj){
                                    },
                                    done: function(res){
                                    if (res.code == 1){
                                    $('#flogo-img').attr('src', res.src);
                                    $('#flogo-img').css('display', 'block');
                                    $('#flogo-val').val(res.src);
                                    return true;
                                    }
                                    },
                                    error: function(){
                                    var errText = $('#flogo-err');
                                    errText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini flogo-reload">重试</a>');
                                    errText.find('.flogo-reload').on('click', function(){
                                    uploadInst.upload();
                                    });
                                    }
                            });
                            });
                        </script>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">网站域名</label>
                        <div class="layui-input-block">
                            <input type="text" name="domain" value="{$system['domain']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">icp备案号</label>
                        <div class="layui-input-block">
                            <input type="text" name="icp" value="{$system['icp']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">版权信息</label>
                        <div class="layui-input-block">
                            <input type="text" name="copyright" value="{$system['copyright']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">公司名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="company" value="{$system['company_name']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">公司介绍</label>
                        <div class="layui-input-block">
                            <textarea type="text" name="introduce" placeholder="" required lay-verify="required" class="layui-textarea">{$system['introduce']?:''}</textarea>
                        </div>
                    </div>
                </div>

                
                   <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">关于我们</label>
                        <div class="layui-input-block">
                            <textarea type="text" name="about" placeholder=""  required lay-verify="required" class="layui-textarea">{$system['about']?:''}</textarea>
                        </div>
                    </div>
                </div>
               

                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">公司地址</label>
                        <div class="layui-input-block">
                            <input type="text" name="addr" value="{$system['addr']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">联系人</label>
                        <div class="layui-input-block">
                            <input type="text" name="uname" value="{$system['contacts']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">电话</label>
                        <div class="layui-input-block">
                            <input type="text" name="tel" value="{$system['mobile']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <label class="layui-form-label">Email</label>
                        <div class="layui-input-block">
                            <input type="text" name="email" value="{$system['email']?:''}" placeholder="" required lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">状态</label>
                        <div class="layui-input-inline">
                            <select name="status">
                                <option value="1">开启访问</option>
                                <option value="0">关闭访问</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-block">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="*" type="button">保存修改</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>

</div>

<script>
    layui.use(['layer', 'jquery', 'form','layedit'], function(){
    var $ = layui.jquery;
    var form = layui.form;
    var layedit=layui.layedit;
    layedit.set({
    	uploadImage:{
    		url: '{:url('upload/articleImage')}',type:'post'
    	}
    })
    var editIndex = layedit.build('content');
    //监听提交
    form.on('submit(*)', function(data){
    data.form.submit();
    return true;
    });
    });
</script>
{/block}
